#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int n,m;
int c[27];
int main()
{
	cin>>n>>m;
	string s1,s2;
	cin>>s1>>s2;
	sort(s2.begin(),s2.end());
	int p1=0,p2=0;
	while(p1<s1.size() && p2<s2.size())
	{
		if(s1[p1]<=s2[p2])
		{
			cout<<s1[p1];
			p1++;
		}
		else{
			cout<<s2[p2];
			p2++;	
		}
	}
	while(p1<s1.size())
	{
		cout<<s1[p1++];
	}
	while(p2<s2.size())
	{
		cout<<s2[p2++];
	}
	return 0;
}
